<template>
    <div class="tabel_header_btn">
        <el-button
            v-if="props.currentTab === '3'"
            v-auth="'commodity:putaway'"
            type="primary"
            @click="$emit('batch', 'putaway')">
            批量上架
        </el-button>
        <el-button v-else v-auth="'commodity:shelves'" type="primary" @click="$emit('batch', 'shelves')">
            批量下架
        </el-button>
        <el-button
            v-if="props.status == '3'"
            v-auth="'commodity:delete'"
            type="primary"
            @click="$emit('batch', 'delete')">
            批量删除
        </el-button>
        <el-button
            v-if="props.status == '3'"
            v-auth="'commodity:delete'"
            type="primary"
            @click="$emit('batch', 'delete')">
            批量删除
        </el-button>
        <el-button v-auth="'commodity:rule'" plain @click="$emit('setShowRule')"> 设置展示规则 </el-button>
    </div>
</template>

<script setup>
const props = defineProps({
    currentTab: { type: String, default: '1' }
});
const emit = defineEmits(['batch', 'setShowRule']);
</script>

<style lang="scss" scoped>
.tabel_header_btn {
    margin-bottom: 16px;
    text-align: right;
}
</style>
